package com.ymatou.iapi.filemanager.service;

import org.json.JSONObject;

import com.ymatou.iapi.fileupload.testcase.Ts_Upload;
import com.ymt.base.YmatouBaseCall;
import com.ymttest.utils.EnvSetup;
/**
*删除文件接口Call
*FreeMaker Template自动生成代码
*/
public class DeleteDFSFileCall extends YmatouBaseCall{
	private static String opurl ="api/File/DeleteDFSFile";
	
	public DeleteDFSFileCall() {
		super(EnvSetup.getSystemUrl("filemanager"),opurl,"POST","PARAM");
	}
//	@Override
//	public void addDefHeader() {
//		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
//		client.addHeader("Content-Type", "application/json; charset=UTF-8");
//	}
	
	/**
	 * 获取文件地址
	 * 
	 * @return
	 */
	public String getFileUrl() {
		String url = null;
		JSONObject Data = null;
		try {
			Data = new JSONObject(getReturnData()).getJSONObject("Result");
			url = Data.getString("FileUrl");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return url;
	}

	/**
	 * 获取Status
	 * 
	 * @return
	 */
	public String getStatus() {
		String Status = null;
		try {
			Status = new JSONObject(getReturnData()).getString("Status");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Status;
	}

	/**
	 * 获取Msg
	 * 
	 * @return
	 */
	public String getMsg() {
		String Msg = null;
		try {
			Msg = new JSONObject(getReturnData()).getString("Msg");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Msg;
	}
	
	/**
	 * 获取IsSuccess
	 * 
	 * @return
	 */
	public String getIsSuccess() {
		String Msg = null;
		try {
			Msg = new JSONObject(new JSONObject(getReturnData()).getString("Result")).getString("IsSuccess");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return Msg;
	}
}